﻿
//生成新聊天窗口
function NewChatWindow(source) {
    //生成新窗口id，实际上是聊天对象的账号
    var WinID = source.value;
    if (document.getElementById(WinID + "_chatWindow") != undefined) { //窗口存在
        document.getElementById(WinID + "_chatWindow").style.zIndex = TopWin++; //上层显示
        return;
    }
    //创建新窗口
    var id1 = WinID + "_chatWindow";
    var id2 = WinID + "_chatWindow_Head ";
    var id3 = WinID + "_chatWindow_OutPut";
    var id4 = WinID + "_chatWindow_InPut";
    document.getElementById("newObj").innerHTML +=
            "<span  class='chatWindow' id='" + id1 + "' >"
            + "<label id='" + id2 + "' class='chatWindow_Head'  onmousedown='MouseDown(this); ' onmousemove='follow(this);' onmouseup='MouseUp(this);' onblur='MouseUp(this);'>和" + WinID + "聊天</label>"
            + "<textarea id='" + id3 + "' class='chatWindow_OutPut' readonly='true'  ></textarea> "
            + "<textarea id='" +id4 + "' class='chatWindow_InPut'></textarea> "
            + "<button  id='" + WinID + "'' class='bt_Send' onclick='sendMessage(this)'>发送</button>"
            + "</span>";
}